package de.karlNet.sambamanager.ldapController.commands;

import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Controller;

import de.karlNet.sambamanager.ldapModel.LdapObject;

@Controller
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
public class RenameLdapObject extends BaseCommand {
	public void renameLdapObject(LdapObject ldapObject) {
		this.ldapTemplate.rename(ldapObject.getDn(), "ou=" + ldapObject.getCn()
				+ "," + ldapObject.getParentDn());
		this.resetTrees();
	}
}
